home *** CD-ROM | disk | FTP | other *** search
- //
- // Monitor input with gain control. Defaults to -6 dB gain.
- // The equal power balance control attenuates everything by 3 dB.
- //
- // MIDI ctl 1 -> gain from -20 dB to 0 dB
- // MIDI ctl 2 -> equal power balance
- //
- // Bill Gardner, October, 1993
- //
- #include "macros.rvb"
-
- #define db_to_gain(db) pow(10,db/20)
- #define gain db_to_gain(init(-6,range(ctl(1),-20,0)))
- #define balance init(0.5, ctl(2))
- #define PI 3.141593
-
- move(Lin,Lout);
- mul(Lout,gain * cos(balance * PI / 2));
- move(Rin,Rout);
- mul(Rout,gain * sin(balance * PI / 2));
-